package com.boot.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.boot.dao.SevenInfoMapper;
import com.boot.entity.SevenInfo;
import com.boot.service.StartSevenService;


@Controller
public class HelloWorldController {

	@Autowired
	private SevenInfoMapper sevenInfoMapper; 
	
	@Autowired
	private StartSevenService sevenService;
	
	@RequestMapping("/")
	public @ResponseBody String home() {
		
		SevenInfo record = new SevenInfo();
		record.setName("name");
		record.setTopic("TOPIC");
		record.setNum("5");
		sevenInfoMapper.insertSelective(record);
		
		return "Hello World!";
	}
	
	@RequestMapping("/start")
	public @ResponseBody String start(String url) {
		
		sevenService.start(url);
		
		return "start mission";
	}

}
